import { NextRequest, NextResponse } from 'next/server'
import { ServiceRegistry } from '@/lib/services/base.service'

export async function GET(request: NextRequest) {
  try {
    const serviceRegistry = ServiceRegistry.getInstance()
    const metrics = serviceRegistry.getAllMetrics()
    
    return NextResponse.json({
      success: true,
      message: 'Metrics retrieved successfully',
      data: metrics
    })
  } catch (error) {
    console.error('Failed to get metrics:', error)
    
    return NextResponse.json({
      success: false,
      message: 'Failed to get metrics',
      details: error instanceof Error ? error.message : 'Unknown error'
    }, { status: 500 })
  }
}
